﻿@model GameSchoolApplication.Models.Test

@{
    ViewBag.Title = "Nánar um próf";
    Layout = "~/Views/Shared/_TeacherMore.cshtml";
}

<h2>Nánar um próf:  @Html.DisplayFor(model => model.TestName)</h2>
<section class="TeacherMainContent">
<table class="IndexTable">
    <caption>Spurningar</caption>
    @if (Model.Questions.Count == 0)
    { 
        <tr><td>Engar spurningar skráðar</td></tr>
    }
    else
    { 
        <tr>
            <th>Texti</th>
            <th>Fjöldi svarmöguleika</th>
            <th>&nbsp;</th>
        </tr>
        foreach (var question in Model.Questions)
        { 
            <tr>
                <td>@question.Content</td>
                <td>@question.Answers.Count</td>
                <td>@Html.ActionLink("Nánar", "Details", "Question", new { id = question.QuestionId}, new {})</td>
            </tr>
        }
    }
</table>

<p>
    @Html.ActionLink("Bæta við spurningu", "Create", "Question", new { testId = Model.TestId}, new {}) |
    @Html.ActionLink("Til baka í lista", "Details", "Level", new { id = Model.LevelId }, new { })
</p>
</section>